const getOptions = require('loader-utils').getOptions;
const validateOptions = require('schema-utils');

const schema = {
  type: 'object',
  properties: {
    test: {
      type: 'string'
    }
  }
};

module.exports = function (source, map, meta) {
  const options = getOptions(this);

  // 对资源应用一些转换……

  // return `export default ${JSON.stringify(source)}`;
  console.log(map, meta);
  console.log(this.loaders)
  //同步
  // return source.replace(/hello/g, 'world')
  // this.callback(null, source, map, 'tony');

  //异步


  const cbk = this.async();

  setTimeout(() => {
    cbk(null, source, map, 'tony');
  }, 1000)


}